<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Manage</title>

<?php 
include("db.php");
session_start();
if(!(isset($_SESSION['_loginasadmin']) && $_SESSION['_loginasadmin']!=0)){
echo "Session has been expired, please relogin.";
echo "The page will redirect to login page in 5 seconds.";

header("refresh:5;url=login.php");
die();
}

?>
<link rel="stylesheet" href="css/screen.css" type="text/css" media="screen" title="default" />
<!--[if IE]>
<link rel="stylesheet" media="all" type="text/css" href="css/pro_dropline_ie.css" />
<![endif]-->

<!--  jquery core -->
<script src="js/jquery/jquery-1.4.1.min.js" type="text/javascript"></script>

<!--  checkbox styling script -->
<script src="js/jquery/ui.core.js" type="text/javascript"></script>
<script src="js/jquery/ui.checkbox.js" type="text/javascript"></script>
<script src="js/jquery/jquery.bind.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
	$('input').checkBox();
	$('#toggle-all').click(function(){
		$('#toggle-all').toggleClass('toggle-checked');
		$('#mainform input[type=checkbox]').checkBox('toggle');
		return false;
	});
});
</script>  

<![if !IE 7]>

<!--  styled select box script version 1 -->
<script src="js/jquery/jquery.selectbox-0.5.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
	$('.styledselect').selectbox({ inputClass: "selectbox_styled" });
});
</script>


<![endif]>

<!--  styled select box script version 2 --> 
<script src="js/jquery/jquery.selectbox-0.5_style_2.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
	$('.styledselect_form_1').selectbox({ inputClass: "styledselect_form_1" });
	$('.styledselect_form_2').selectbox({ inputClass: "styledselect_form_2" });
});
</script>

<!--  styled select box script version 3 --> 
<script src="js/jquery/jquery.selectbox-0.5_style_2.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
	$('.styledselect_pages').selectbox({ inputClass: "styledselect_pages" });
});
</script>

<!--  styled file upload script --> 
<script src="js/jquery/jquery.filestyle.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
	$("input.file_1").filestyle({ 
image: "images/forms/choose-file.gif",
		imageheight : 21,
		imagewidth : 78,
		width : 310
	});
});
</script>

<!-- Custom jquery scripts -->
<script src="js/jquery/custom_jquery.js" type="text/javascript"></script>

<!-- Tooltips -->
<script src="js/jquery/jquery.tooltip.js" type="text/javascript"></script>
<script src="js/jquery/jquery.dimensions.js" type="text/javascript"></script>
<script type="text/javascript">


$(function() {
	$('a.info-tooltip ').tooltip({
track: true,
delay: 0,
fixPNG: true, 
showURL: false,
showBody: " - ",
top: -35,
left: 5
	});
});
</script> 

<script type="text/javascript">

function submit_form(pagename, id){
	document.getElementById('selectedid').value = id;
	document.getElementById('submitid').action = pagename;
	document.getElementById('submitid').submit();
}
</script>

<!--  date picker script -->
<link rel="stylesheet" href="css/datePicker.css" type="text/css" />
<script src="js/jquery/date.js" type="text/javascript"></script>
<script src="js/jquery/jquery.datePicker.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
$(function()
{

	// initialise the "Select date" link
	$('#date-pick')
	.datePicker(
	// associate the link with a date picker
	{
createButton:false,
startDate:'01/01/2005',
endDate:'31/12/2020'
	}
	).bind(
	// when the link is clicked display the date picker
	'click',
	function()
	{
		updateSelects($(this).dpGetSelected()[0]);
		$(this).dpDisplay();
		return false;
	}
	).bind(
	// when a date is selected update the SELECTs
	'dateSelected',
	function(e, selectedDate, $td, state)
	{
		updateSelects(selectedDate);
	}
	).bind(
	'dpClosed',
	function(e, selected)
	{
		updateSelects(selected[0]);
	}
	);
	
	var updateSelects = function (selectedDate)
	{
		var selectedDate = new Date(selectedDate);
		$('#d option[value=' + selectedDate.getDate() + ']').attr('selected', 'selected');
		$('#m option[value=' + (selectedDate.getMonth()+1) + ']').attr('selected', 'selected');
		$('#y option[value=' + (selectedDate.getFullYear()) + ']').attr('selected', 'selected');
	}
	// listen for when the selects are changed and update the picker
	$('#d, #m, #y')
	.bind(
	'change',
	function()
	{
		var d = new Date(
		$('#y').val(),
		$('#m').val()-1,
		$('#d').val()
		);
		$('#date-pick').dpSetSelected(d.asString());
	}
	);

	// default the position of the selects to today
	var today = new Date();
	updateSelects(today.getTime());

	// and update the datePicker to reflect it...
	$('#d').trigger('change');
});

$('.select').click(function(){
    $(this).parent().find('.current').addClass('select');
    $(this).addClass('current');
});


</script>

<!-- MUST BE THE LAST SCRIPT IN <HEAD></HEAD></HEAD> png fix -->
<script src="js/jquery/jquery.pngFix.pack.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
	$(document).pngFix( );
});
</script>
</head>
<body> 
<form id="submitid" method="post">
<input type="hidden" value="" id="selectedid" name="selectedid" />
</form>
<!-- Start: page-top-outer -->
<div id="page-top-outer">    

<!-- Start: page-top -->
<div id="page-top">

<!-- start logo -->
<div id="logo">
<a href=""><img src="images/shared/logo.png" width="156" height="40" alt="" /></a>
</div>
<!-- end logo -->

<!--  start top-search -->
<div id="top-search">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td></td>
<td>
</td>
<td>
</td>
</tr>
</table>
</div>
<!--  end top-search -->
<div class="clear"></div>

</div>
<!-- End: page-top -->

</div>
<!-- End: page-top-outer -->

<div class="clear">&nbsp;</div>

<!--  start nav-outer-repeat................................................................................................. START -->
<div class="nav-outer-repeat"> 
<!--  start nav-outer -->
<div class="nav-outer"> 

<!-- start nav-right -->
<div id="nav-right">

<div class="nav-divider">&nbsp;</div>
<a href="logout.php" id="logout"><img src="images/shared/nav/nav_logout.gif" width="64" height="14" alt="" /></a>
<div class="clear">&nbsp;</div>

</div>
<!-- end nav-right -->


<?php
$currentname = ucfirst(pathinfo($_SERVER['PHP_SELF'], PATHINFO_FILENAME));
?>

<!--  start nav -->
<div class="nav">
<div class="table">

<ul <?php if(strcasecmp($currentname, 'allresto')==0 || strcasecmp($currentname, 'addresto')==0 ) echo "class='current'"; else echo "class='select'" ?>><li><a href="allresto.php"><b>Restaurants</b><!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<div class="select_sub show">
<ul class="sub">
<li <?php if(strcasecmp($currentname, 'allresto')==0) echo "class='sub_show'"; ?>><a href="allresto.php">View all restaurants</a></li>
<li <?php if(strcasecmp($currentname, 'addresto')==0) echo "class='sub_show'"; ?>><a href="addresto.php" >Add a restaurent</a></li>
</ul>
</div>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
</ul>

<div class="nav-divider">&nbsp;</div>

<ul <?php if(strcasecmp($currentname, 'allusers')==0) echo "class='current'"; else echo "class='select'" ?>><li><a href="allusers.php"><b>Users</b><!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<div class="select_sub show">
<ul class="sub">
<li <?php if(strcasecmp($currentname, 'allusers')==0) echo "class='sub_show'"; ?>><a href="allusers.php">View all users</a></li>
</ul>
</div>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
</ul>


<div class="nav-divider">&nbsp;</div>

<ul <?php if(strcasecmp($currentname, 'allreserv')==0) echo "class='current'"; else echo "class='select'" ?>><li><a href="allreserv.php"><b>Reservations</b><!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<div class="select_sub show">
<ul class="sub">
<li <?php if(strcasecmp($currentname, 'allreserv')==0) echo "class='sub_show'"; ?>><a href="allreserv.php">View all reservations</a></li>
</ul>
</div>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
</ul>

<div class="nav-divider">&nbsp;</div>

<ul <?php if(strcasecmp($currentname, 'editkac')==0) echo "class='current'"; else echo "class='select'" ?>><li><a href="editkac.php"><b>Enterprise info</b><!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<div class="select_sub show">
<ul class="sub">
<li <?php if(strcasecmp($currentname, 'editkac')==0) echo "class='sub_show'"; ?>><a href="editkac.php">Edit enterprise info</a></li>
</ul>
</div>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
</ul>

<div class="nav-divider">&nbsp;</div>

<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
<!--  start nav -->

</div>
<div class="clear"></div>
<!--  start nav-outer -->
</div>
<!--  start nav-outer-repeat................................................... END -->

<div class="clear"></div>

<!-- start content-outer ........................................................................................................................START -->
<div id="content-outer">
<!-- start content -->
<div id="content">
